//导入 createStore 函数  apply 应用      合并 reducer 
import {createStore, applyMiddleware, combineReducers} from 'redux';
//导入 redux-thunk  thunk 转换程序
import {thunk} from 'redux-thunk';
//导入 reducer 函数
import countReducer from './reducers/countReducer';
import zanReducer from './reducers/zanReducer';
//导入开发者工具
import {composeWithDevTools} from 'redux-devtools-extension'

//合并两个 reducer 函数, redux 中保存的状态将变为『对象』
// {count: 5201314, zan: 0}
let reducer = combineReducers({
  count: countReducer,
  zan: zanReducer
});

//创建 store 对象 createStore create 创建 store 仓库
let store = createStore(reducer, composeWithDevTools(applyMiddleware(thunk)));

//暴露 store 对象
export default store;

